#include "head.h"

int recvn(int netfd,void* buf,int length){
    char* p=(char*)buf;
    int cursize=0;
    while(cursize<length){
        int ret=recv(netfd,p+cursize,length-cursize,0);
        if(ret==0){
            return 0;
        }
        cursize+=ret;
    }
    return length;
}
